# Contributor: Clayton Craft <clayton@craftyguy.net>
# Maintainer: Clayton Craft <clayton@craftyguy.net>
pkgname=ccls
pkgver=0.20210330_git20220417
pkgrel=0
_gitrev=74458915b3472b0df26264d7d1599505385cf453
pkgdesc="C/C++/Objective-C language server"
url="https://github.com/MaskRay/ccls"
arch="all"
license="Apache-2.0"
makedepends="
	clang-dev
	clang-static
	cmake
	llvm-dev
	llvm-static
	rapidjson-dev
	samurai
	zlib-dev
	"
source="$pkgname-$pkgver.tar.gz::https://github.com/MaskRay/ccls/archive/$_gitrev.tar.gz"
builddir="$srcdir/$pkgname-$_gitrev"
options="!check"  # no tests

build() {
	cmake -G Ninja \
		-DCMAKE_INSTALL_PREFIX=/usr \
		-DCMAKE_C_COMPILER=clang \
		-DCMAKE_CXX_COMPILER=clang++ \
		-DCLANG_LINK_CLANG_DYLIB=on \
		-DLLVM_LINK_LLVM_DYLIB=on \
		-Bbuild
	cmake --build build
}

package() {
	DESTDIR="$pkgdir" cmake --install build
}

sha512sums="
e4f163c1de6e64394a28944d4e806850fd6574d0f888e91b1a42d2b58d29442559f187c8e26b3a40e5bb6d482daf16a5f03d18bd9e3b07baee7fb5888d31d618  ccls-0.20210330_git20220417.tar.gz
"
